package com.wzh.store.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wzh.store.entity.Address;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @Author wzh
 * @create 2022/4/22 15:20
 * @Description： 收货地址持久层操作
 */
@Repository
public interface AddressMapper extends BaseMapper<Address> {
    /**
     * 根据用户uid来查询用户的地址数目，最多不可以超过29条
     * @param uid
     * @return 当前的用户的收货地址的总数
     */
    Integer countByUId(Integer uid);

    List<Address> findByUid(Integer uid);

    Address findByAid(Integer aid);

    Integer updateNonDefault(Integer uid);

    Integer updateDefaultByAid(Integer aid,String modifiedUser, Date modifiedTime);

    void deleteByAid(Integer aid);

    Address findLastModified(Integer uid);





}
